package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 活动
 * @author 16693103420
 * @since 2024-01-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("tb_activity")
public class ActivityModel implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;//商家活动表ID
    private String activityName;//活动名称
    private Double price;//价格
    private Double originalPrice;//原价
    private Double preferential;//优惠内容
    private String cover;//活动封面
    private String consumeNotice;//消费须知
    private String serviceGuarantee;//服务保障
    private String validPeriod;//有效期限
    private String groupBuyingDetails;//团购详情
    private String consumeNoticeDetails;//消费须知详情
    private Integer businessId;//商家ID
    private Integer isPick;//是否甄选活动 1是2否
    private Integer status;
    private Integer number;//库存
    private Integer classification;//分类
    private String groupBuyingId;//团购ID
    private Long viewCount;
    @TableField(exist = false)
    private String classificationText;
    @TableField(exist = false)
    private List<BusinessModel> businessList;// 此活动适用门店
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;
    @TableField(exist = false)
    private String pick;
    @TableField(exist = false)
    private Integer sold;
    @TableField(exist = false)
    private Integer count;
    @TableField(exist = false)
    private String password;
    @TableField(exist = false)
    private transient String businessAddress;
    @TableField(exist = false)
    private transient Double longitude;
    @TableField(exist = false)
    private transient Double latitude;
    @TableField(exist = false)
    private transient Double distance;
    //活动倒计时的结束时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    /**
     * 商家ids
     */
    private String businessIds;
    private transient List<GroupBuyingCategory> groupBuyingCategoryList;
}
